import os
from openpyxl import Workbook,load_workbook



if __name__ == "__main__":

    xlsx_path = "./output"

    wb = Workbook()
    wv = wb.active

    # wv.append(["影像编号",
    #             "Center Latitude",
    #             "Center Longitude",
    #             "Lower Left Latitude",
    #             "Lower Left Longitude",
    #             "Lower Right Latitude",
    #             "Lower Right Longitude",
    #             "Upper Left Latitude",
    #             "Upper Left Longitude",
    #             "Upper Right Latitude",
    #             "Upper Right Longitude"
    #             ])

    files = os.listdir(xlsx_path)    

    #wb_list = []

    for file in files:
        dir_path = os.path.join(xlsx_path,file)

        wb_temp = load_workbook(dir_path,read_only=True)

        ws_temp = wb_temp.active

        for row in ws_temp.iter_rows(min_row=2,values_only=True):

        #wb_list.append(wb_temp)
            wv.append(row)
        
        wb_temp.close()

    wb.save("output_results_all.xlsx")
    print("拼接完成")


